#pragma once

#include "Log.hpp"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <strings.h>
#include <arpa/inet.h>

using namespace LogModule;

class InetAddr
{
    public:
    InetAddr(struct sockaddr_in addr)
        :_addr(addr)
    {
        _ip = inet_ntoa(_addr.sin_addr);
        _port = ntohs(_addr.sin_port);
    }

    std::string GetIp()
    {
        return _ip;
    }
    int GetPort()
    {
        return _port;
    }
    ~InetAddr()
    {

    }
    private:
    struct sockaddr_in _addr;
    std::string _ip;
    int _port;
};